package ThreadTest;

class MyNameThread implements Runnable{


    @Override
    public void run() {
        for (int i=0;i<=10;i++){
            System.out.println(Thread.currentThread().getName()+"运行,i="+i);
        }

    }
}



public class namedemo {
    public static void main(String[] args) {
        MyNameThread my=new MyNameThread();
        new Thread(my).start();
        new  Thread(my,"线程a").start();
        new Thread(my).start();
        my.run();
    }

}
